package com.ruoyi.lvlian.vo;


import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.lvlian.domain.InvoiceDetails;
import com.ruoyi.lvlian.domain.InvoiceInfo;
import com.ruoyi.lvlian.domain.PaymentInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 完税（发票）信息列表查询视图层实体类
 */
@Data
@ToString
@ApiModel(value = "完税vo信息", description = "完税vo信息")
@Schema(description = "完税vo信息请求参数")
public class InvoiceVo extends InvoiceInfo {

    @ApiModelProperty(value = "支付状态")
    private String paymentStatus;

    @ApiModelProperty(value = "支付金额")
    private Double paymentAmount;

    @ApiModelProperty(value = "结算状态")
    private String settlementStatus;

    @ApiModelProperty(value = "结算金额")
    private Double settlementAmount;

    @ExcelProperty("项目名称")
    private String goodsName;

    @ExcelProperty("批次")
    private int batchCnt;

    public String getPaymentStatus() {
        paymentStatus = "未支付";
        if (getPaymentAmount() ==null ||  getPaymentAmount() == 0) {
            return "未支付";
        }
        int result = getPaymentAmount().compareTo( getTotalAmount());

        if (result==0) {
            paymentStatus = "全部支付";
        }
        if (result>0 || result<0) {
            paymentStatus = "部分支付";
        }

        return paymentStatus;
    }

    public String getSettlementStatus() {
        settlementStatus = "未结算";
        if (getSettlementAmount() ==null || getSettlementAmount() == 0) {
            return "未结算";
        }
        int result = getSettlementAmount().compareTo( getTotalAmount());
        if (result==0) {
            settlementStatus = "全部结算";
        }
        if (result>0 || result<0) {
            settlementStatus = "部分结算";
        }

        return settlementStatus;
    }

    private String paymentType;
    private Double payAmount;
    private Double  transactionAmount;
    @ApiModelProperty("发票金额")
    private Double fapiaoAmount;
    @ApiModelProperty(value = "完税证明")
    private boolean taxCertificate;
    @ApiModelProperty(value = "物流发票")
    private String LogisticsInvoice;
    @ApiModelProperty("本次结算对应的发票金额")
    private Double fapiaoSettlementAmount;
}
